import 'package:flutter/material.dart';
import 'package:my_app/app/core/theme/app_text_theme.dart';

class CustomTileWidget extends StatelessWidget {
  final String title;

  final String? subTitle;

  final String? assetImageName;

  final GestureTapCallback? onTap;

  const CustomTileWidget(
      {super.key,
      required this.title,
      this.subTitle,
      this.assetImageName,
      this.onTap});

  @override
  Widget build(BuildContext context) {
    return ListTile(
      dense: true,
      leading: assetImageName != null
          ? Container(
              height: 45,
              width: 45,
              decoration: BoxDecoration(
                  shape: BoxShape.circle,
                  color: Colors.white,
                  image: DecorationImage(
                    image: AssetImage('$assetImageName'),
                  )),
            )
          : null,
      title: Text(
        title,
        style: tileTitle,
      ),
      subtitle: Text('$subTitle'),
      trailing: Icon(
        Icons.arrow_forward_ios,
        size: 16.0,
      ),
      onTap: onTap,
    );
  }
}
